class Foo{
    constructor(value){
        this.values = value;
    }
    *[Symbol.iterator](){
        yield * this.values;
    }
}
const f = new Foo([1,2,3,4,5]);
for(const x of f){
    console.log(x);
}
//  